package com.feemanage.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.common.validate.add;
import com.common.validate.edit;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.framework.config.BigDecimalSerializer;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 银行到款
 */
@Data
@TableName("biz_cw_income")
public class BizCwIncome  extends myBaseEntity {

    private static final long serialVersionUID = 1L;

    /** 编码ID */
    @TableId(value = "id",type = IdType.ASSIGN_UUID)
    @NotNull(message = "id不能为空", groups = {edit.class})
    private String id;

    /** 凭单号 */
    private String code;

    /** 来款日期 */
    @NotNull(message = "来款日期不能为空", groups = {add.class,edit.class})
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime incomeDate;

    /** 来款金额 */
    @NotNull(message = "来款金额不能为空", groups = {add.class,edit.class})
    @JsonSerialize(using = BigDecimalSerializer.class)
    private BigDecimal feeValue;

    /** 摘要 */
    @NotBlank(message = "摘要不能为空", groups = {add.class,edit.class})
    private String note;

    /** 经费状态 */
    private String feeStatus;

    /** 来款单位 */
    @NotBlank(message = "来款单位不能为空", groups = {add.class,edit.class})
    private String incomeUnit;

    /** 对冲号 */
    @NotBlank(message = "对冲号不能为空", groups = {add.class,edit.class})
    private String cwDch;

    /** 来款类型 */
    private String incomeType;

    /** 凭证内码 */
    private String cwPznm;

    /** 分录编号 */
    private String cwFlbh;

    /** 往来辅助标识 */
    private String smark;

    private String recommendPersonId;

}
